package cn.edu.scujcc;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/music")
    public class MusicController {
	@Autowired
	private MusicService service;
	@GetMapping
	public List<Music> getAllMusic(){
		List<Music>result = null;
		result = service.getAllMusic();
		return result;
	}
	@GetMapping("/{id}")
	public Music getMusic(@PathVariable String id) {
	Music result = null;
	result = service.getMusic(id);
	return result;
	}
	
	@PostMapping("/comment")
	public Music createComment(@PathVariable String comment) {
	Music result = null;
	result = service.createComment(comment);
	return result;
	}	
	
}